 function demo(probid)

addpath C:\Users\Administrator\Desktop\sabb\testfunctionset

if (probid == 1)
    fun = @bard;
    disp('bard function, dim = 3');
    x0 = ones(3,1);
end
if (probid == 2)
     disp('bard2 function, dim = 3');
    fun = @bard2;
    x0 = [0.4,1,0]';
end
if (probid == 3)
    disp('broyden function, dim = n ');
    fun = @broyden;
    n = input('please input probelm dimension: ');
    x0 = -1*ones(n,1);
end
if (probid == 4)
    disp('beale function, dim = 2');
    fun = @beale;
   % n = input('please input probelm dimension: ');
    x0 = [1,1]';
end
% if (probid == 5)
%     disp('waston function, dim = n');  %2=<n<=31
%     fun = @waston;
%     n = input('please input probelm dimension: ');
%     x0 = zeros(n,1);
% end
if (probid == 5)
    disp('rosenbrock function, dim = 2');
    fun = @rosenbrock;
%     n = input('please input probelm dimension: ');
    x0 = [-1.2,1]'; 
end

if (probid == 6)
    disp('tridiagal function, dim = n');
    fun = @tridiagal;
    n = input('please input probelm dimension: ');
    x0 = ones(n,1);
end

if (probid == 7)
    disp('freroth function, dim = 2');
    fun = @freroth;
   % n = input('please input probelm dimension: ');
    x0 = [0.5,-2]' ;
end

if (probid == 8)
    disp('bdqrtic function, dim = n');
    fun = @bdqrtic;
    n = input('please input probelm dimension: ');
    x0 = ones(n,1);
end

if (probid == 9)
    disp('arwhead function, dim = n');
    fun = @arwhead;
    n = input('please input probelm dimension: ');
    x0 = ones(n,1);
end

if (probid == 10)
    disp('auglinb function, dim = n');
    fun = @auglinb;
    n = input('please input probelm dimension: ');
    x0 = ones(n,1);
end
% if (probid == 12)
%     disp('gulf function,   dim = 3');
%     fun = @gulf;
%    % n = input('please input probelm dimension: ');
%     x0 = [5,2.5,0.15]';
% end

if (probid == 11)
    disp('box3 function, dim = 3');
    fun = @box3;
   % n = input('please input probelm dimension: ');
    x0 = [0,10,20]';
end

% if (probid == 14)
%     disp('brown function, dim = 2');
%     fun = @brown;
%    % n = input('please input probelm dimension: ');
%     x0 = [1,1]';
% end

if (probid == 12)
    disp('broy-trid function, dim = n');
    fun = @broy_trid;
    n = input('please input probelm dimension: ');
    x0 = -ones(n,1);
end

if (probid == 13)
    disp('brown_dennis function, dim = 4');
    fun = @brown_dennis;
   % n = input('please input probelm dimension: ');
    x0 = [25,5,-5,-1]';
end

if (probid == 14)
    disp('curly20 function, dim = n');
    fun = @curly20;
   n = input('please input probelm dimension: ');
    x0 = ( 0.001/(n+1))*ones(n,1);
end


if (probid == 15)
    disp('Diagonal-1 function, dim = n');
    fun = @Diagonal_1;
   n = input('please input probelm dimension: ');
    x0 = (1/n)*ones(n,1);
end

if (probid == 16)
    disp('Diagonal-2 function, dim = n');
    fun = @Diagonal_2;
    n = input('please input probelm dimension: ');
    x0 = ones(n,1); 
    for i = 1:n  
        x0(i)=1/i;  
    end
end

if (probid == 17)
    disp('Diagonal-3 function, dim = n');
    fun = @Diagonal_3;
    n = input('please input probelm dimension: ');
    x0 = ones(n,1); 
end

if (probid == 18)
    disp('Diagonal-4 function, dim = n');
    fun = @Diagonal_4;
    n = input('please input probelm dimension: ');
    x0 = ones(n,1); 
end

if (probid == 19)
    disp('Diagonal-5 function, dim = n');
    fun = @Diagonal_5;
    n = input('please input probelm dimension: ');
    x0 = 1.1*ones(n,1); 
end

if (probid == 20)
    disp('Diagonal-6 function, dim = n');
    fun = @Diagonal_6;
    n = input('please input probelm dimension: ');
    x0 = ones(n,1); 
end

if (probid == 21)
    disp('Diagonal-7 function, dim = n');
    fun = @Diagonal_7;
    n = input('please input probelm dimension: ');
    x0 = ones(n,1); 
end

if (probid == 22)
    disp('Diagonal-8 function, dim = n');
    fun = @Diagonal_8;
    n = input('please input probelm dimension: ');
    x0 = ones(n,1); 
end

% if (probid == 26)
%     disp('Diagonal-9 function, dim = n');
%     fun = @Diagonal_9;
%     n = input('please input probelm dimension: ');
%     x0 = ones(n,1); 
% end

if (probid == 23)
    disp('DixmaanA function, dim = n');
    fun = @dixmaanA;
    n = input('please input probelm dimension: ');
    x0 = 2*ones(n,1); 
end

if (probid == 24)
    disp('DixmaanB function, dim = n');
    fun = @dixmaanB;
    n = input('please input probelm dimension: ');
    x0 = 2*ones(n,1); 
end

if (probid == 25)
    disp('DixmaanC function, dim = n');
    fun = @dixmaanC;
    n = input('please input probelm dimension: ');
    x0 = 2*ones(n,1); 
end

% if (probid == 30)
%     disp('DixmaanD function, dim = n');
%     fun = @dixmaanD;
%     n = input('please input probelm dimension: ');
%     x0 = 2*ones(n,1); 
% end

if (probid == 26)
    disp('DixmaanE function, dim = n');
    fun = @dixmaanE; 
    n = input('please input probelm dimension: ');
    x0 = 2*ones(n,1); 
end

% if (probid == 32)
%     disp('DixmaanF function, dim = n');
%     fun = @dixmaanF; 
%     n = input('please input probelm dimension: ');
%     x0 = 2*ones(n,1); 
% end

if (probid == 27)
    disp('DixmaanG function, dim = n');
    fun = @dixmaanG; 
    n = input('please input probelm dimension: ');
    x0 = 2*ones(n,1); 
end

if (probid == 28)
    disp('DixmaanH function, dim = n');
    fun = @dixmaanH; 
    n = input('please input probelm dimension: ');
    x0 = 2*ones(n,1); 
end

% if (probid == 35)
%     disp('DixmaanI function, dim = n');
%     fun = @dixmaanI; 
%     n = input('please input probelm dimension: ');
%     x0 = 2*ones(n,1); 
% end
% 
% if (probid == 36)
%     disp('DixmaanJ function, dim = n');
%     fun = @dixmaanJ;
%     n = input('please input probelm dimension: ');
%     x0 = 2*ones(n,1); 
% end

if (probid == 29)
    disp('DixmaanK function, dim = n');
    fun = @dixmaanK; 
    n = input('please input probelm dimension: ');
    x0 = 2*ones(n,1); 
end

% if (probid == 38)
%     disp('DixmaanL function, dim = n');
%     fun = @dixmaanL; 
%     n = input('please input probelm dimension: ');
%     x0 = 2*ones(n,1); 
% end

if (probid == 30)
    disp('Dqdrtic function, dim = n');
    fun = @dqdrtic;
    n = input('please input probelm dimension: ');
    x0 = 3*ones(n,1); 
end

if (probid == 31)
    disp('E-Fre-Roth function, dim = n');
    fun = @e_freroth;
    n = input('please input probelm dimension: ');
    x0 = 0.5*ones(n,1); 
    for i = 2:2:n 
        x0(i)=-2; 
    end
end

if (probid == 32)
    disp('EG2 function, dim = n');
    fun = @eg2;
    n = input('please input probelm dimension: ');
    x0 = ones(n,1); 
end

if (probid == 33)
    disp('Extended Hiebert Function, dim = n');
    fun = @e_h1;
    n = input('please input probelm dimension: ');
    x0 = zeros(n,1); 
end

if (probid == 34)
    disp('Extended Himmelblau Function, dim = n');
    fun = @e_h2;
    n = input('please input probelm dimension: ');
    x0 = zeros(n,1); 
end

if (probid == 35)
    disp('Almost Perturbed Quadratic Function, dim = n');
    fun = @apq;
    n = input('please input probelm dimension: ');
    x0 = 0.5*ones(n,1); 
end

if (probid == 36)
    disp('DQDRTIC  Function, dim = n');
    fun = @dqdrtic;
    n = input('please input probelm dimension: ');
    x0 = 3*ones(n,1); 
end

if (probid == 37)
    disp('Extended Block Diagonal 1 Function, dim = n');
    fun = @e_bd1;
    n = input('please input probelm dimension: ');
    x0 = 0.1*ones(n,1); 
end

if (probid == 38)
    disp('Extended Beale Function, dim = n');
    fun = @e_beale;
    n = input('please input probelm dimension: ');
    x0 = ones(n,1); 
    for i=2:2:n
        x0(i)=0.8;
    end
end

% if (probid == 48)
%     disp('Extended Cliff  Function, dim = n');
%     fun = @e_cliff;
%     n = input('please input probelm dimension: ');
%     x0 = zeros(n,1); 
%     for i=2:2:n
%         x0(i)=-1;
%     end
% end

if (probid == 39)
    disp('Extended EP1 Function , dim = n');
    fun = @e_ep1;
    n = input('please input probelm dimension: ');
    x0 = 0.5*ones(n,1); 
end

if (probid == 40)
    disp('Extended Penalty Function , dim = n');
    fun = @e_penalty;
    n = input('please input probelm dimension: ');
    x0 = zeros(n,1); 
    for i = 1:n
        x0(i) = i;
    end
end

if (probid == 41)
    disp('Extended Powell Function, dim = n');
    fun = @e_powell;
    n = input('please input probelm dimension: ');
    x0 = zeros(n,1); 
    for i = 1:n
        x0(2*i-1) = 3;
        x0(2*i) = -1;
        x0(2*i+1) = 0;
        x0(2*i+2) = 1;
    end
end

if (probid == 42)
    disp('Extended PSC1 Function, dim = n');
    fun = @e_psc1;
    n = input('please input probelm dimension: ');
    x0 = 3*ones(n,1); 
    for i = 2:2:n
        x0(i) = 0.1;
    end
end

if (probid == 43)
    disp('Extended Quadratic Penalty 1 Function, dim = n');
    fun = @e_qp1;
    n = input('please input probelm dimension: ');
    x0 = ones(n,1); 
end

if (probid == 44)
    disp('Extended Quadratic Penalty 2 Function, dim = n');
    fun = @e_qp2;
    n = input('please input probelm dimension: ');
    x0 = ones(n,1); 
end

if (probid == 45)
    disp('Extended Rosenbrock function, dim = n');
    fun = @e_rb;
    n = input('please input probelm dimension: ');
    x0 = ones(n,1); 
    for i = 1:2:n
        x0(i) = -1.2;
    end
end

if (probid == 46)
    disp(' Extended Trigonometric function, dim = n');
    fun = @e_t;
    n = input('please input probelm dimension: ');
    x0 = 0.2*ones(n,1); 
end

if (probid == 47)
    disp('Extended Tridiagonal-1 Function, dim = n');
    fun = @e_t1;
    n = input('please input probelm dimension: ');
    x0 = 2*ones(n,1); 
end

if (probid == 48)
    disp('Extended Tridiagonal-2 Function, dim = n');
    fun = @e_t2;
    n = input('please input probelm dimension: ');
    x0 = ones(n,1); 
end

if (probid == 49)
    disp('Extended Three Exponential Terms 1 function, dim = n');
    fun = @e_tet1;
    n = input('please input probelm dimension: ');
    x0 = 0.1*ones(n,1); 
end

if (probid == 50)
    disp('Extended Three Exponential Terms 2 function, dim = n');
    fun = @e_tet2;
    n = input('please input probelm dimension: ');
    x0 = -1*ones(n,1); 
end

if (probid == 51)
    disp(' Extended White & Holst function, dim = n');
    fun = @e_wh;
    n = input('please input probelm dimension: ');
    x0 = ones(n,1); 
    for i = 1:2:n
        x0(i) = -1.2;
    end
end

if (probid == 52)
    disp( 'Extended Wood Function, dim = n');
    fun = @e_wood;
    n = input('please input probelm dimension: ');
    x0 = zeros(n,1); 
    for i = 1:n
        x0(2*i-1) = -3;
        x0(2*i) = -1;
    end
end

if (probid == 53)
    disp('Extended Maratos Function, dim = n');
    fun = @em;
    n = input('please input probelm dimension: ');
    x0 = zeros(n,1); 
    for i=1:n
        x0(2*i-1) = 1.1;
        x0(2*i) = 0.1;
    end
end

if (probid == 54)
    disp('Full Hessian FH1 Function, dim = n');
    fun = @fh1;
    n = input('please input probelm dimension: ');
    x0 = 0.01*ones(n,1); 
end

if (probid == 55)
    disp('Full Hessian FH2 Function, dim = n');
    fun = @fh2;
    n = input('please input probelm dimension: ');
    x0 = 0.01*ones(n,1); 
end

if (probid == 56)
    disp('Full Hessian FH3 Function, dim = n');
    fun = @fh3;
    n = input('please input probelm dimension: ');
    x0 = ones(n,1); 
end

% if (probid == 67)
%     disp('FLETCBV3 Fuction, dim = n');
%     fun = @fletcbv3;
%     n = input('please input probelm dimension: ');
%     x0 = zeros(n,1); 
%     h = 1/(n+1);
%     for i = 1:n
%         x0(i) = i*h;
%     end
% end

if (probid == 57)
    disp('FLETCHCR Function, dim = n');
    fun = @fletchcr;
    n = input('please input probelm dimension: ');
    x0 = zeros(n,1); 
end

if (probid == 58)
    disp('Freudenstein and Roth function, dim = 2');
    fun = @freandroth;
%     n = input('please input probelm dimension: ');
    x0 = [0.5,-2]'; 
end

if (probid == 59)
    disp(' Generalized PSC1 Function, dim = n');
    fun = @g_psc1;
    n = input('please input probelm dimension: ');
    x0 = zeros(n,1); 
    for i = 1:n
        x0(2*i-1) = 3;
        x0(2*i) = 0.1;
    end
end

if (probid == 60)
    disp('Generalized Rosenbrock function, dim = n');
    fun = @g_rb;
    n = input('please input probelm dimension: ');
    x0 = zeros(n,1); 
    for i=1:n
        x0(2*i-1) = -1.2;
        x0(2*i) = 1;
    end
end

if (probid == 61)
    disp('Generalized Tridiagonal-1 Function, dim = n');
    fun = @g_t1;
    n = input('please input probelm dimension: ');
    x0 = 2*ones(n,1); 
end

% if (probid == 73)
%     disp('Generalized White & Holst function, dim = n');
%     fun = @g_wh;
%     n = input('please input probelm dimension: ');
%     x0 = zeros(n,1); 
%    for i=1:n
%         x0(2*i-1) = -1.2;
%         x0(2*i) = 1;
%    end
% end

if (probid == 62)
    disp('Hager Function, dim = n');
    fun = @hager;
    n = input('please input probelm dimension: ');
    x0 = ones(n,1); 
end

if (probid == 63)
    disp('Helical vally function, dim = 3');
    fun = @helical;
%     n = input('please input probelm dimension: ');
    x0 = [-1 0 0]';
end

if (probid == 64)
    disp('Jennrich and Sampson function, dim = 2');
    fun = @jen_sampson;
%     n = input('please input probelm dimension: ');
    x0 = [0.3 0.4]'; 
end

if (probid == 65)
    disp('Kowalik and Osborne function, dim = 4');
    fun = @kowa;
%     n = input('please input probelm dimension: ');
    x0 = [0.25,0.39,0.415,0.39]'; 
end

% if (probid == 78)
%     disp('Meyer function, dim = 3');
%     fun =@meyer;
% %     n = input('please input probelm dimension: ');
%     x0 = [0.02,4000,250]'; 
% end

if (probid == 66)
    disp(' NONDIA  Function, dim = n');
    fun = @nondia;
    n = input('please input probelm dimension: ');
    x0 = zeros(n,1); 
    for i = 1:n
        x0(i) = -1;
    end
end

if (probid == 67)
    disp('NONDQUAR Function, dim = n');
    fun = @nondquar;
    n = input('please input probelm dimension: ');
    x0 = ones(n,1); 
    for i = 2:2:n
        x0(i) = -1;
    end
end

if (probid == 68)
    disp('Powell badly scaled function, dim = 2');
    fun = @pbs;
%     n = input('please input probelm dimension: ');
    x0 = [0 1]'; 
end

if (probid == 69)
    disp('Powell singular function, dim = 4');
    fun = @ps;
%     n = input('please input probelm dimension: ');
    x0 =[3,-1,0,1]'; 
end

if (probid == 70)
    disp('Partial Perturbed Quadratic Function, dim = n');
    fun = @ppq;
    n = input('please input probelm dimension: ');
    x0 = 0.5*ones(n,1); 
end

if (probid == 71)
    disp('Perturbed Quadratic function, dim = n');
    fun = @pq;
    n = input('please input probelm dimension: ');
    x0 = 0.5*ones(n,1); 
end

if (probid == 72)
    disp('Quadratic Diagonal Perturbed Function, dim = n');
    fun = @qdp;
    n = input('please input probelm dimension: ');
    x0 = 0.5*ones(n,1); 
end

if (probid == 73)
    disp(' Quadratic Function 1, dim = n');
    fun = @e_penalty;
    n = input('please input probelm dimension: ');
    x0 = ones(n,1); 
end

if (probid == 74)
    disp('Quadratic Function 2, dim = n');
    fun = @qf2;
    n = input('please input probelm dimension: ');
    x0 = 0.5*ones(n,1);
end

if (probid == 75)
    disp('Raydan 1 Function, dim = n');
    fun = @raydan1;
    n = input('please input probelm dimension: ');
    x0 = ones(n,1)/n; 
end

% if (probid == 89)
%     disp('Raydan 2 function, dim = n');
%     fun = @raydan2;
%     n = input('please input probelm dimension: ');
%     x0 = ones(n,1)/n; 
% end
% 
% if (probid == 90)
%     disp('Scaled Quadratic1, dim = n');
%     fun = @sq1;
%     n = input('please input probelm dimension: ');
%     x0 = zeros(n,1); 
%     for i=1:n
%         x0(i)=i;
%     end
% end
% 
% if (probid == 91)
%     disp('Scaled Quadratic 2 , dim = n');
%     fun = @sq2;
%     n = input('please input probelm dimension: ');
%     x0 = zeros(n,1); 
%     for i=1:n
%         x0(i)=i;
%     end
% end

if (probid == 76)
    disp('Tridiagonal Perturbed Quadratic  Function, dim = n');
    fun = @tpq;
    n = input('please input probelm dimension: ');
    x0 = zeros(n,1); 
    for i=1:n
        x0(i)=0.5;
    end
end

if (probid == 77)
    disp('Wood function, dim = 4');
    fun = @wood;
%     n = input('please input probelm dimension: ');
    x0 = [-3,-1,-3,-1]'; 
end

if (probid == 78)
    disp('staircase 1 function, dim = n');
    fun = @sc1;
    n = input('please input probelm dimension: ');
    x0 = ones(n,1); 
end

if (probid == 79)
    disp('staircase 2 function, dim = n');
    fun = @sc2;
    n = input('please input probelm dimension: ');
    x0 = zeros(n,1); 
end

if (probid == 80)
    disp('LIARWHD function, dim = n');
    fun = @liarwhd;
    n = input('please input probelm dimension: ');
    x0 = 4*ones(n,1); 
end

if (probid == 81)
    disp(' power function, dim = n');
    fun = @power1;
    n = input('please input probelm dimension: ');
    x0 = ones(n,1); 
end

if (probid == 82)
    disp(' ENGVAL1 function, dim = n');
    fun = @engval1;
    n = input('please input probelm dimension: ');
    x0 = 2*ones(n,1); 
end

if (probid == 83)
    disp('CRAGGLVY function, dim = n');
    fun = @cragglvy;
    n = input('please input probelm dimension: ');
    x0 = zeros(n,1); 
    x0(1) = 1;
    for i=2:n
        x0(i)=2;
    end
end

if (probid == 84)
    disp('EDENGSCH function, dim = n');
    fun = @edengsch;
    n = input('please input probelm dimension: ');
    x0 = zeros(n,1); 
end

% if (probid == 101)
%     disp('INDEF function, dim = n');
%     fun = @indef;
%     n = input('please input probelm dimension: ');
%     x0 = zeros(n,1); 
%     h=n+1;
%     for i=1:n
%         x0(i)=i/h;
%     end
% end

if (probid == 85)
    disp('CUBE function, dim = n');
    fun = @cube;
    n = input('please input probelm dimension: ');
    x0 = ones(n,1); 
    for i=1:2:n
        x0(i)=-1.2;
    end
end

if (probid == 86)
    disp('ARGLINC function, dim = n');
    fun = @arglinc;
    n = input('please input probelm dimension: ');
    x0 = ones(n,1); 
end

% if (probid == 104)
%     disp('EXPLIN1  function, dim = n');
%     fun = @explin1;
%     n = input('please input probelm dimension: ');
%     x0 = zeros(n,1); 
% end
% 
% if (probid == 105)
%     disp('EXPLIN2 function, dim = n');
%     fun = @explin2;
%     n = input('please input probelm dimension: ');
%     x0 = zeros(n,1); 
% end

if (probid == 87)
    disp('EX.DENSCHNB function, dim = n');
    fun = @exden;
    n = input('please input probelm dimension: ');
    x0 = ones(n,1); 
end

if (probid == 88)
    disp('EX. DENSCHNN function , dim = n');
    fun = @exden1;
    n = input('please input probelm dimension: ');
    x0 = zeros(n,1); 
    for i=1:2:n
        x0(i)=2;
    end
end

if (probid == 89)
    disp(' BDEXP function, dim = n');
    fun = @bdexp;
    n = input('please input probelm dimension: ');
    x0 = ones(n,1); 
end

if (probid == 90)
    disp(' HARKERP2 function, dim = n');
    fun = @harkerp2;
    n = input('please input probelm dimension: ');
    x0 = zeros(n,1); 
    for i=1:n
        x0(i)=i;
    end
end

% if (probid == 110)
%     disp('GENHUMPS  function, dim = n');
%     fun = @genhumps;
%     n = input('please input probelm dimension: ');
%     x0 = 506.2*ones(n,1); 
% end

if (probid == 91)
    disp(' MCCORMCK  function, dim = n');
    fun = @mccormck;
    n = input('please input probelm dimension: ');
    x0 = ones(n,1); 
end

if (probid == 92)
    disp('VARDIM function, dim = n');
    fun = @vardim;
    n = input('please input probelm dimension: ');
    x0 = zeros(n,1); 
    for i=1:n
        x0(i)=1-i/n;
    end
end

if (probid == 93)
    disp('NONSCOMP function, dim = n');
    fun = @nonscomp;
    n = input('please input probelm dimension: ');
    x0 = 3*ones(n,1); 
end

if (probid == 94)
    disp('SINQUAD function, dim = n');
    fun = @sinquad;
    n = input('please input probelm dimension: ');
    x0 = 0.1*ones(n,1); 
end

if (probid == 95)
    disp('DIXON3DQ function, dim = n');
    fun = @dixon;
    n = input('please input probelm dimension: ');
    x0 = -1*ones(n,1); 
end

if (probid == 96)
    disp('SINE  function, dim = n');
    fun = @sine;
    n = input('please input probelm dimension: ');
    x0 = ones(n,1); 
end

if (probid == 97)
    disp('SINCOS function, dim = n');
    fun = @sincos;
    n = input('please input probelm dimension: ');
    x0 = 0.1*ones(n,1); 
    for i=1:2:n
        x0(i)=3;
    end
end

if (probid == 98)
    disp(' COSINE function, dim = n');
    fun = @cosine;
    n = input('please input probelm dimension: ');
    x0 = ones(n,1); 
end

% if (probid == 119)
%     disp(' BIGGSB1 function, dim = n');
%     fun =@biggsb1;
%     n = input('please input probelm dimension: ');
%     x0 = zeros(n,1); 
% end

if (probid == 99)
    disp('Generalized quartic function , dim = n');
    fun = @g_q;
    n = input('please input probelm dimension: ');
    x0 = ones(n,1); 
end

if (probid == 100)
    disp('HIMMELBG function, dim = n');
    fun = @himmelbg;
    n = input('please input probelm dimension: ');
    x0 = 1.5*ones(n,1); 
end

% if (probid == 122)
%     disp('HIMMELBH function, dim = n');
%     fun = @himmelbh;
%     n = input('please input probelm dimension: ');
%     x0 = 1.5*ones(n,1); 
% end



%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

[xstar,infos] = SABB(fun,x0)



[xst,info] = NMBB(fun,x0);

st = tic();
[xstar,fst,ef,outp,gst] = fminunc(fun,x0);
fminst = toc(st);
% ng = norm(gst);


 
% fprintf('prob      iter       bb        rator       cput      iter     bb        rator      cput      cput \n')
% 
% fprintf('&%d  &%-4d   &%-4d   &%-0.4f   &%0.4f   &%-4d   &%-4d   &%-0.4f   &%0.4f  &%0.4f \n' ,probid, infos.iter,infos.bb,infos.rator,infos.time,info.iter,info.bb,info.rator,info.time,fminst)



% fprintf('SABB        %-4d      %-4d      %-0.4f       %0.4f \n',infos.iter,infos.bb,infos.rator,infos.time)
% fprintf('NMBB        %-4d      %-4d      %-0.4f       %0.4f \n',info.iter,info.bb,info.rator,info.time)
% fprintf('fminunc                                    %0.4f \n',fminst)
%        




% %SABB method
%  fprintf('results of SABB \n');
%  fprintf('iter= %d,bb = %d,rator = %0.4f,cput = %0.4f \n\n',infos.iter,infos.bb,infos.rator,infos.time);
%  
%  %NMBB method
% fprintf('results of BB method with nonmonotone ls \n');
% fprintf('iter= %d,bb = %d, rator = %0.4f,cput = %0.4f \n\n',info.iter,info.bb,info.rator,info.time);
% 
% %"fminunc" function in Matlab toolbox
% fprintf('results of fminunc \n'); 
% fprintf('cput = %0.4f \n\n',fminst);
